package com.yuanduo_app.ui.rn;

import android.os.Bundle;

import com.chenenyu.router.annotation.Route;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import com.yuanduo_app.base.BaseRNActivity;
import com.yuanduo_app.route.RouteName;
import com.xujl.fastlib.base.BaseView;
import com.xujl.fastlib.base.IControl;
import com.xujl.fastlib.base.LayoutBuilder;
@Route(RouteName.COMMON_PAGE)
public class RnCommonActivityControl extends BaseRNActivity {
    @Override
    protected String getMainComponentName () {
        return "RnCommonActivityControl";
    }

    @Override
    protected void init (Bundle savedInstanceState) {

    }

    @Override
    protected BaseView createDefaultView () {
        return new BaseView() {
            @Override
            public void init (IControl control) {

            }

            @Override
            public LayoutBuilder configLayout () {
                return super.configLayout().setEnableDataBinding(false).setEnableAutoSetLayout(false);
            }
        };
    }

    @Override
    protected ReactActivityDelegate createReactActivityDelegate () {
        return new ReactActivityDelegate(this, getMainComponentName()) {
            @Override
            protected ReactRootView createRootView () {
                return new RNGestureHandlerEnabledRootView(RnCommonActivityControl.this);
            }
        };
    }

    @Override
    public boolean enableFragmentBack () {
        return false;
    }

}
